import request from './request'

const commentApi = {
  // 添加评论
  addComment(comment) {
    return request({
      url: '/comment/add',
      method: 'post',
      data: comment
    })
  },
  
  // 删除评论
  deleteComment(contentId, articleId, userId) {
    return request({
      url: '/comment/delete',
      method: 'delete',
      params: {
        contentId,
        articleId,
        userId
      }
    })
  },

  getComments(articleId) {
    return request({
      url: '/comment/list',
      method: 'get',
      params: {
        articleId
      }
    })
  }
}

export default commentApi